package jh.com.jhappbf.dispatchcar;


import android.content.Intent;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;

import jh.com.jhappbf.R;
import jh.com.jhappbf.verify.VerifyDispatchListView;

public class DispatchCarManager extends Fragment implements OnClickListener {
    private ImageView mAddDispatchImg;
    private ImageView mQueryDispatchImg;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.dispatch_main_activity, null);
        initView(v);
        return v;
    }

    /**
     * 初始化
     */
    private void initView(View v) {
        mAddDispatchImg = v.findViewById(R.id.dispatch_car_add_img);
        mQueryDispatchImg = v.findViewById(R.id.dispatch_car_query_img);
        mAddDispatchImg.setOnClickListener(this);
        mQueryDispatchImg.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.dispatch_car_add_img:
                Intent i = new Intent(getActivity(), DispatchCarAdd.class);
                i.putExtra("flag", "add");
                getActivity().startActivity(i);
                break;
            case R.id.dispatch_car_query_img:
                Intent i1 = new Intent(getActivity(), DispatchCarQuery.class);
                getActivity().startActivity(i1);
                break;
            default:
                break;
        }
    }
}